<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:setBundle basename="messages.messages"/>

<html>
<head>

<link rel="stylesheet" href="/Epics/jslib/global.css" />
<script src="/Epics/jslib/jquery-1.9.1.js"></script>
<script src="/Epics/jslib/jquery.validate.min.js"></script>

<script type="text/javascript">
	$(document).ready(
			function() {

				$("#inputForm").validate({
					rules : {
						title : {
							required : true
						}
					},
					messages : {
						title :{
							required:"Type title."
						}
					}
				});
			
			});
</script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><fmt:message key="siteName"/></title>
</head>
<body>
	<%@ include file="../Template/TMainLine.jsp" %>
	<%@ include file="../Template/TMessage.jsp"%>

	<form id="inputForm" action="SChangePhotoSettingsOut" accept-charset="UFT-8" method="post">
		<h1>${photo.title}</h1>
		<img src="${photo.location }"/><br/>
		<input type="hidden" name="photoId" value="${photo.id }"/>
		<table>
			<tr>
				<td>Title:</td>
				<td><input type="text" name="title" value="${photo.title }"/></td>
			</tr>
			<tr>
				<td>Description:</td>
				<td><textarea name="description" rows="5" cols="40">${photo.description }</textarea></td>
			</tr>
			<!-- 
			<tr>
				<td>Album:</td>
				<td>
					<select name="album">
						<c:forEach items="${albums}" var="album">
							<c:choose>
								<c:when test="${album.id==currentAlbum.id}">
									<option value="${album.id}" selected>${album.title}</option>
								</c:when><c:otherwise>
									<option value="${album.id}">${album.title}</option>
								</c:otherwise>
							</c:choose>
						</c:forEach>
					</select>
				</td>
			</tr>
			 -->
			<tr>
				<td colspan="2">
					<c:choose>
						<c:when test="${photo.pub }">
							<input type="checkbox" name="ispublic" value="ispublic" checked/>
						</c:when><c:otherwise>
							<input type="checkbox" name="ispublic" value="ispublic"/>
						</c:otherwise>
					</c:choose>
				Public</td>
			</tr>
			<tr>
				<td colspan="2">
					<c:choose>
						<c:when test="${photo.tagsAllowed }">
							<input type="checkbox" name="tagsAllowed" value="tagsAllowed" checked/>
						</c:when><c:otherwise>
							<input type="checkbox" name="tagsAllowed" value="tagsAllowed"/>
						</c:otherwise>
					</c:choose>
				Tags allowed</td>
			</tr>
			<tr>
				<td colspan="2">
					<c:choose>
						<c:when test="${photo.notesAllowed }">
							<input type="checkbox" name="notesAllowed" value="notesAllowed" checked/>
						</c:when><c:otherwise>
							<input type="checkbox" name="notesAllowed" value="notesAllowed"/>
						</c:otherwise>
					</c:choose>
				Notes allowed</td>
			</tr>
			<tr>
				<td colspan="2">
					<c:choose>
						<c:when test="${photo.commentsAllowed }">
							<input type="checkbox" name="commentsAllowed" value="commentsAllowed" checked/>
						</c:when><c:otherwise>
							<input type="checkbox" name="commentsAllowed" value="commentsAllowed"/>
						</c:otherwise>
					</c:choose>
				Comments allowed</td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="Add image" /></td>
			</tr>
		</table>
	</form>
</body>
</html>